Add GeneratedCodeAttribute to Generated code#621
Conversation
|
@AArnott If you could give this a quick review that would be great. |
AArnott
left a comment
There was a problem hiding this comment.
Thanks for contributing. I think you're almost there.
|
@AArnott, the remaining test failures are a bit of a strange one. They are all off by one tab space. If you call |
|
Thank you for getting us this far. I hope to look more into this today or tomorrow. |
|
@sharwell this code causes the xml comment to have an extra leading tab white space: typeDeclaration = typeDeclaration
.WithLeadingTrivia()
.AddAttributeLists(AttributeList().AddAttributes(GeneratedCodeAttribute))
.WithLeadingTrivia(typeDeclaration.GetLeadingTrivia());The generated code attribute is: private static readonly AttributeSyntax GeneratedCodeAttribute = Attribute(IdentifierName("global::System.CodeDom.Compiler.GeneratedCode"))
.WithArgumentList(FixTrivia(AttributeArgumentList().AddArguments(
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(ThisAssembly.AssemblyName))),
AttributeArgument(LiteralExpression(SyntaxKind.StringLiteralExpression, Literal(ThisAssembly.AssemblyInformationalVersion))))));It seems like an issue in Roslyn, but its more likely PEBKAC. Is there anything obvious I have missed? |
|
@AArnott Youssef1313 pointed out in the roslyn issue that the problem is in Edit: It looks like there is an issue in |
aa5fe0a to
d60d410
Compare
|
@elachlan Can you see if elachlan#1 fixes the issue? |
|
I'll pull yours down now and check it. |
|
@Youssef1313 I have pushed through some more changes around for loop indenting. This is what its generating at the moment inside Edit: it might actually just be single line. |
|
I gave up on the for loops. I have fixed the other test issues. We can fix the rest of the white space issues in another PR. |
|
@AArnott can you give this another review? |
|
@Youssef1313 thank you for your help on this! It helped immensely. |
AArnott
left a comment
There was a problem hiding this comment.
Thank you for your contribution. I would never have guessed this required so much work. I appreciate your dedication.

Closes #594